package com.ruoyi.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.domain.OtherBlocketRecord;
import com.ruoyi.system.domain.OtherHostRecord;
import com.ruoyi.system.domain.OtherMicSlotClaim;
import com.ruoyi.system.mapper.OtherBlockedRecordMapper;
import com.ruoyi.system.mapper.OtherHostRecordMapper;
import com.ruoyi.system.service.IOtherBlockedRecordService;
import com.ruoyi.system.service.IOtherHostRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
@DataSource(value = DataSourceType.SLAVE)
public class OtherHostRecordServiceImpl extends ServiceImpl<OtherHostRecordMapper, OtherHostRecord> implements IOtherHostRecordService {
    @Resource
    private OtherHostRecordMapper otherHostRecordMapper;

    @DataSource(value = DataSourceType.SLAVE)
    public List<HashMap> getHostRecord(String roomId, String startDate, String endDate, String startTime, String endTime){
        return otherHostRecordMapper.getHostRecord(roomId,startDate,endDate,startTime,endTime);
    }

    @DataSource(value = DataSourceType.SLAVE)
    public List<OtherHostRecord> getHostRecordByMember(String roomId, String wxid, String startDate, String endDate, String startTime, String endTime){
        return otherHostRecordMapper.getHostRecordByMember(roomId,wxid,startDate,endDate,startTime,endTime);
    }

    @DataSource(value = DataSourceType.SLAVE)
    public List<Map<String, Object>> getMemberLastRecord(QueryWrapper<OtherHostRecord> queryWrapper){
        return otherHostRecordMapper.getMemberLastRecord(queryWrapper);
    }

}
